<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<html>
  <head>
   
    
    <title></title>
   			
	<link href = "css/bootstrap.css" rel = "stylesheet" type = "text/css"/>
	

  </head>
  
  <body>
  
  		<div class="navbar">
			<div class="navbar-inner">
				<div class="container" style="width: auto;">
					<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					</a>
					<a class="brand" href="#">品竹缘健康生活管</a>
					<div class="nav-collapse">
						<ul class="nav">
							<li class="active">
							<a href="#">登录页</a>
							</li>
							
							
							
							
			
						</ul>
			
					</div>
				</div>
			</div>
		</div>
		
		<form id="loginForm" onsubmit="return valedateform()" action="user.jspx?task=login" method="post">
	  	<div class="actions">
	  			用户名:<input type="text" id ="username" class="text" name="username"/>
	  			
	  			<span id = "errorname" style="color:red"></span>
	  	</div>
	  	
	  	<div class="actions">
	  		密码:<input type="password" id ="userpwd" class="text" name="userpwd"/>
	  		<span id = "errorpwd" style="color:red"></span>
	  		
	  		<br/>
	  	</div>
	  
  		<div class="actions">
  			<input id="loginBtn" class="btn large primary" type="submit" value="登录"/>
  			
  		</div>
  		
  		
  		
  	</form>	
  	
  	
  	<script type="text/javascript">
	  	function valedateform(){
	  		var username = document.getElementById("username").value;
	  		var password = document.getElementById("userpwd").value;
	  		
	  		if(username.trim().length == 0){
	  			
	  			document.getElementById("errorname").innerHTML ="用户名不能为空";
	  			document.getElementById("username").focus();
	  			return false;
	  			
	  		}else if(password.length == 0){
	  			document.getElementById("errorpwd").innerHTML = "密码不能为空";
	  			document.getElementById("userpwd").focus();
	  			return false;
	  		}
	  		return true;
		  		
  		}
  		
  	
  	</script>
    
  </body>
</html>
